projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7959ad9
)
show: Print an error message if commit doesn't have detached metadata
author
Colin Walters
<walters@verbum.org>
Thu, 26 Sep 2013 17:57:59 +0000
(13:57 -0400)
committer
Colin Walters
<walters@verbum.org>
Thu, 26 Sep 2013 17:57:59 +0000
(13:57 -0400)
...instead of segfaulting.
src/ostree/ot-builtin-show.c
patch
|
blob
|
history
diff --git
a/src/ostree/ot-builtin-show.c
b/src/ostree/ot-builtin-show.c
index 09aaead7fa21cf12530fa03ae21e911ef33ac3c6..859c3d149970a021d2733fdd3b70ab95b03e09b2 100644
(file)
--- a/
src/ostree/ot-builtin-show.c
+++ b/
src/ostree/ot-builtin-show.c
@@
-124,6
+124,12
@@
do_print_metadata_key (OstreeRepo *repo,
if (!ostree_repo_read_commit_detached_metadata (repo, resolved_rev, &metadata,
NULL, error))
goto out;
+ if (metadata == NULL)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ "No detached metadata for commit %s", resolved_rev);
+ goto out;
+ }
}
if (!g_variant_lookup (metadata, key, "&s", &value))